'use strict';

const config = require('../config');

exports.tokenRequired = function * (next) {
  const token = this.header['x-token'];
  if (token !== config.app.token) this.throw(401);
  yield next;
}
